import 'package:boss/models/pay_info_form.dart';
import 'package:json_annotation/json_annotation.dart';

part 'mch_data.g.dart';

@JsonSerializable()
class MchData extends Object {
  PayInfoForm merchantPayInfo;

  WechatHistory wechatHistory;

  WechatHistory alipayHistory;

  MchData(
    this.merchantPayInfo,
    this.wechatHistory,
    this.alipayHistory,
  );

  factory MchData.fromJson(Map<String, dynamic> srcJson) => _$MchDataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$MchDataToJson(this);
}

@JsonSerializable()
class MerchantPayInfo extends Object {
  int id;

  int storeId;

  String businessCode;

  String wechatAccount;

  String alipayAccount;

  String businessLicense;

  String idCardNumber;

  String idCardCopy;

  String idCardNational;

  String idCardStartTime;

  String idCardEndTime;

  String accountName;

  String accountBank;

  String bankAddressCode;

  String bankName;

  String accountNumber;

  String bankCardPositive;

  String bankCardBack;

  String storeEntrancePic;

  String indoorPic;

  String phone;

  String email;

  int deleted;

  String ctime;

  String utime;

  MerchantPayInfo(
    this.id,
    this.storeId,
    this.businessCode,
    this.wechatAccount,
    this.alipayAccount,
    this.businessLicense,
    this.idCardNumber,
    this.idCardCopy,
    this.idCardNational,
    this.idCardStartTime,
    this.idCardEndTime,
    this.accountName,
    this.accountBank,
    this.bankAddressCode,
    this.bankName,
    this.accountNumber,
    this.bankCardPositive,
    this.bankCardBack,
    this.storeEntrancePic,
    this.indoorPic,
    this.phone,
    this.email,
    this.deleted,
    this.ctime,
    this.utime,
  );

  factory MerchantPayInfo.fromJson(Map<String, dynamic> srcJson) => _$MerchantPayInfoFromJson(srcJson);

  Map<String, dynamic> toJson() => _$MerchantPayInfoToJson(this);
}

@JsonSerializable()
class WechatHistory extends Object {
  int id;

  int payInfoId;

  int serviceType;

  String businessCode;

  String applyId;

  int applyStatus;

  String subMchId;

  String signUrl;

  String auditDetail;

  String deleted;

  String ctime;

  String utime;

  WechatHistory(
    this.id,
    this.payInfoId,
    this.serviceType,
    this.businessCode,
    this.applyId,
    this.applyStatus,
    this.subMchId,
    this.signUrl,
    this.auditDetail,
    this.deleted,
    this.ctime,
    this.utime,
  );

  factory WechatHistory.fromJson(Map<String, dynamic> srcJson) => _$WechatHistoryFromJson(srcJson);

  Map<String, dynamic> toJson() => _$WechatHistoryToJson(this);
}
